<template>
  <div class="son">
    这是子组件
    {{ msg }} <br />
    传来的值: {{ props.data }} <br />
    <button @click="toFu">父传子</button>
  </div>
</template>

<script setup>
import { ref } from "vue";
let msg = ref("子组件的值");
let props = defineProps({
  data: String,
});
let emit = defineEmits(["fu"]);
let toFu = () => {
  emit("fu", 222);
};
</script>

<style scoped lang="scss">
</style>
